Using macros with a smartmodem by Dr. Ripco

first go to the install part of ae (% from terminal).

when the main install menu comes up, select F for the macro action characters.
set the table up for the following:

        slow speed character            ?
        delay character                 *
        handshake request character     %
        internal command character      \
        string search character         {
        string search end character     }
        literal send character          @
        macro <cr> character            '
        macro border character          |
        macro conditional character     ~
        wildcard handshake              =

note that some of the characters are already defined and you will be only
changing 3 or 4 of them. the charcters from default are ok to use but i
have found that many systems use the defaults in thier logon routines and
confuse the macro.

now that thats done, save the install and return to ae. i am not going to
try to explain what all the action characters do since the following
examples will somewhat self-explain.

now the fun part, trying to write the macro. first thing is to logon to one
of the systems you wish to make a macro for. you have to make notations on
how the logon proceedure works, step by step. the easiest way is check for
the prompts when the host system is asking for your name and or password.

many systems use ---> or (> or (_> or even [(>. the point is to see what
the system is outputting just before it askes for your info. these prompts
are what we will tell ae to look for so it can trigger on them. make sure
to make notes on all the prompts, at least the ones that will get you into
the system. from there, there is no point to use macros (like getting mail
and shit).

now for actually writing the macro. the ae macro system is developed from 2
different parts of ae, the macro editor and the editor itself. you will
need to use both.
we will start with the macro editor itself, since its the most complicated.
from terminal mode, hit U. this will enter into the macro editor. a screen
will appear, blank at this point since no macro was loaded in. i cannot
tell you how to set up all the different parts, since all of these are
based on what type of system you are calling. for the most part you only
have to set up the baud rate. the rest of the info is defaulted and i can't
think of any of them that are important to change. using a smartmodem, you
do not even have to set up the phone # since the number is defined in the
macro itself.

hit D from this menu to display/edit the macros. you should have the numbers
#0 to #9 displayed on the screen with no info after them. if you do, clear
the macro (C).
the following example is for autoredial to a system that uses --> for the
prompt, and askes for 2 things, a user number and a password. this macro
will auto redial until the connection is made.

#0 (leave blank)
#1 **\L2
#2 ATDT555-1212''~NC3\U4\L2
#3 ***''{-->}*99'{-->}*PASSWORD''
#4 ******

leave #5 to #9 blank.

the explination: the macro will be executed by hitting control w 1 after
the macro is loaded from ae terminal mode. #1 of this macro is more or less
a dummy. the reason its there is for possible changes that have to be made
to the macro at a later date. (note: if you are using a promodem 1200 change
#1 to read ATV1'**\L2). what the above #1 is doing is waiting 1/2 second,
thats the (**) then linking to #2 (\L2)

macro #2 is dialing the phone number (ATDT555-1212) and sending 2 carriage
returns (''). the reason for 2 returns is beacuse ae sends the macro so fast,
the modem sometimes misses the first one. now for the tricky stuff, the next
character is the ~. this tells ae that the next sequence of characters are
conditional, depending on what the modem is outputting after the dial is
made. ONE IMPORTANT NOTE: the above macro was based on the hayes smartmodem
1200 which returns NO CARRIER if connection was not established or CONNECT
if it was. your smartmodem (if different) must be forced to act like a hayes
for the example to work right. Adding the ATH1 to #1 (for the promodem) will
do this or by adding ATX0 (for the courier 2400). the next characters are
the NC3 in the example. the N is based on the first character the modem
outputted. if it was an N (NO CARRIER) the macro jumps over the C3 to the
\ and executes what is after it. in this case its U4 which means basically
gosub #4 and return. macro #4 is simply a 1 or 2 second delay (*******) which
simply gives a delay for the phone line to be cleared. after this, the flow
jumps back to the \L2 (in line #2) which simply says 'link to #2' or even
more simply, start this line over again.

if, the first time around, the macro did get a CONNECT, the letter C would
jump to line #3. (NC3). thus whatever number is after the C would jump to
the line # within the macro. so summing up line #2, its similar to a IF THEN
statement in basic.

line #3 controls how you want the macro to send your personal information to
log onto the host system. this line could be omitted altogether but you
would have to enter the user # and password manually. the *** again is just
a delay to stablize the connection and for the 2 systems to get thier shit
together. the following '' is sending 2 carriage returns which is required
on many systems. like i said before, ae sends the macro characters at a very
fast rate and you might find that adding a * or two between the '' could help
on the logon. the next sequence {-->} is telling your system to wait until
the series of characters that make up --> is sent by the host. when the
sequence is sent (some systems have logon messages before it) the macro is
delayed again (*) and then sends 99 (the user # in the example). this is
followed by a carriage return ('). the macro then waits again for the
sequence of -->  (from the second {-->} ) waits again, then sends the password
(PASSWORD in the example) followed by 2 carriage returns.

by studing the above example and the explanation you should be able to
customize it to any system you are calling. it takes work to make it run
the right way. one trick is that if you call IBM based systems (along with
TBBS types) they send a control E before asking for your input. thus just
change the stuff between the { } to control e instead of -->.

if the macro seems to missfire, check to see if they are using the trigger
characters before the logon proceedure. remember the macro is only waiting
for a series of things to happen. it can't tell the difference from when
its supposed to work and when not to. for example...

                --> Welcome to The Bullshit Barn <---
Enter User #
-->

will cause the macro to puke because --> was used before the title.
either add a delay before the first {-->} to skip over the one in the
title or change it to {#} with several *'s after it. the flow control in
the macros are flexible and many combinations are possible.

now that the macro is written, return back to the macro editor main menu.
use the W command to write it to disk. for the filename, enter in a short
abbreviation of the name of the system the macro is for. not that this is
all that important, but its easier to figure out what to load back in if
you have to re-edit it. for example if the name of the system was really
the bullshit barn, save it under the name BB . the macro editor will then
proceed to save it, but under the name BB.MAC . a somewhat important note
here....try to remember not to use the same name for a different macro.
When the macro editor saves the file, it doesn't check to see if the file
exists or not, if it does, it overwrites the file without giving the
File Exists! delete Y/N? prompt.

e(X)it the macro edit. you should be back to the terminal mode of ae.

hit ^q Y to enter the text editor. clear it if not empty. (.C)

hit return to skip line 0. you cannot enter information on it anyway.
now you have to decide one thing, the letter of the alphabet that will
load in the macro when you want to call it up. since this will be your
first macro and none others exist yet except BB.MAC, you might as well use
the letter B (for bullshit barn). on line 1, type the following:

b/the bullshit barn/bb

the 'b' is the letter you selected that you want to call the macro up.
the 'the bullshit barn' is the name of the system, this name will be
displayed when the macro is loaded in.
the 'bb' is the name of the file you saved under the macro editor. remember
that the .MAC was added, but do not enter this in. 

since this the only entry at this point, save this file to disk by typing
 .p macro.lib on line 2. when you add more macros at a future time, simply
load this file back in (with a .g macro.lib) and insert or add them in the
same format. remember not to use line 0 for any entries.

there is a maximum of 26 entries since ae only allows the letters A-Z to
call up macros.

now to see if things work....exit the editor by using .x .

now that you are in terminal mode of ae, do a control q then M. it will
respond with a  A-Z /,? prompt. the slash (/) if entered, will diplay the
macro.lib file and list all the entries made. it will display both the system
name and what letter to hit to load it in. try it.

returning to terminal mode, do another control q then M. now hit the letter
B from the A-Z /,? prompt. the drive should turn on and display:

the bullshit barn <macro loaded>

back in terminal mode again, hit control q them M again, except this time
hit the ? . this will display all the elements in current macro.

to get the macro to start auto dialing, simply do a control w then 1.
line #1 of the current macro will then be executed. since the macro is
self looping, this is the only entry you have to make. if you added the
ATV1 or the ATX0, this will be displayed on you screen, if not the first
thing you will see is the ATDT555-1212. from here on in, the macro will
loop, talking back and forth to the modem.

to cancel the execution, you have to hit return 2 times during an output.
if you attempt to do it while in a delay cycle (#4 in the example), it
won't stop.

this example macro will redial the number and attempt to connect about 9 or 10
times a minute. this can be increased by shorting the *'s in line #4 of the
macro, but be warned that some phone systems don't clear that fast between
calls. to increase the delay times between attempts, add in more *'s to line
#4 of the macro. each * adds in about 1/4 to 1/2 second delay.


thats about it. i know it looks complicated at first, but after you get the
feel of handling macros, its really easy since you can simply modify one
macro by editing it and using on another system. another words, once one
macro is written, it can be used to spawn others following the same ideas
and command structure above.

one note about the promodem and macros, due to the response codes it sends
to the monitor, make sure you turn off the built in auto-redial (switch 9
to ON) because if in the hayes emulation mode (ATV1 or switch 3 to ON) it
will return BUSY instead of NO CARRIER.

suggested swich setting for the promodem:
1-on  2-on  3-on  4-n/a  5-off  6-on  7-off  8-on  9-on  10-on


suggested switch settings for the courier 2400:
1-down  2-up  3-down  4-up  5-n/a  6-down  7-up  8-down  9-down  

also its a good idea to send a ATZ to the modem to clear it and reset.
rememeber to send a ATX0 to the courier before the macro is loaded, or
enter ATX0 to line #1 of the macro. also remember to set the baud rate
in the macro editor, it will automatically change when the macro is
loaded in. (no more ^q B !!).

suggested switch settings for the apple super serial card-
sw1: 1-down  2-up  3-up  4-up 5-up  6-up  7-up
sw2: 1-up  2-up  3-down  4-up  5-down  6-up  7-down

this allows the card to use interupts with ae and defaults the initial baud
rate to 1200. (overided by loading a macro in).

any questions can be directed to the Ripco Bbs  (312) 528-5020

                                        Dr. Ripco